﻿namespace PhotobucketNet
{
    using System.Collections.Generic;
    using System.Xml;

    public class MediaTagList : List<MediaTag>
    {
        internal static MediaTagList CreateFromXmlDocument(XmlDocument document)
        {
            return CreateFromXmlNodeList(document.SelectNodes("descendant::content"));
        }

        internal static MediaTagList CreateFromXmlNodeList(XmlNodeList mediaTagNodes)
        {
            MediaTagList list = new MediaTagList();
            foreach (XmlNode node in mediaTagNodes)
            {
                list.Add(MediaTag.CreateFromXmlNode(node));
            }
            return list;
        }

        internal static MediaTagList CreateFromXmlResponseMessage(XmlResponseMessage responseMessage)
        {
            return CreateFromXmlDocument(responseMessage.ResponseXml);
        }
    }
}

